//
//  TYBaseTableViewCell.m
//  Tunnel
//
//  Created by wbb on 2025/6/2.
//

#import "TYBaseTableViewCell.h"

@implementation TYBaseTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}
- (instancetype)init {
    self = [super init];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
+ (instancetype)nibCell {
    return  [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
}
- (void)setCornerForIndexPath:(NSIndexPath *)indexPath totalRows:(NSInteger)totalRows  {
    if (indexPath.row == 0) {
        // 第一个单元格
        self.contentView.layer.cornerRadius = 7.0f;
        self.contentView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
    } else if (indexPath.row == totalRows - 1) {
        // 最后一个单元格
        self.contentView.layer.cornerRadius = 7.0f;
        self.contentView.layer.maskedCorners = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner;
    } else {
        // 其他单元格
        self.contentView.layer.cornerRadius = 0.0f;
        self.contentView.layer.maskedCorners = 0;
    }
    self.contentView.backgroundColor = [UIColor whiteColor];
}
- (void)cellWithData:(id)data {
    
}

@end

